//
//  UserfulForeCell.m
//  JinChengYun
//
//  Created by 金橙云 on 2017/3/20.
//  Copyright © 2017年 金橙云. All rights reserved.
//

#import "UserfulForeCell.h"
#import "JGPopView.h"

@implementation UserfulForeCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        _firstLab= [[UILabel alloc] init];
        _firstLab.text = @"客户姓名呀 :";
        _firstLab.font = [UIFont systemFontOfSize:14];
        _firstLab.textColor =[UIColor blackColor];
        [self addSubview:_firstLab];
        [_firstLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(90, 18));
            make.top.equalTo(self.mas_top).offset(15);
            make.left.equalTo(self.mas_left).offset(8);
        }];
        
        _selectBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        _selectBtn.titleLabel.font = [UIFont systemFontOfSize:14];
        _selectBtn.layer.borderColor = [UIColor grayColor].CGColor;
        [_selectBtn.layer setBorderWidth:0.5];
        _selectBtn.layer.cornerRadius = 5;
        UIImageView *img = [[UIImageView alloc] initWithFrame:CGRectMake(160, 8, 11, 11)];
        img.image = [UIImage imageNamed:@"sanJiao"];
        [_selectBtn addSubview:img];
        [_selectBtn setTitleColor:[UIColor blackColor] forState:0];
        [_selectBtn setTitle:@"无" forState:0];
        [_selectBtn addTarget:self action:@selector(selectBtnClick:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_selectBtn];
        [_selectBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake(180, 30));
            make.top.equalTo(self.mas_top).offset(9);
            make.left.equalTo(self.mas_left).offset(105);
            
        }];

      [_selectBtn setShowsTouchWhenHighlighted:YES];
        
    }
    return self;
}



-(void)selectBtnClick:(UIButton *)btn
{
    if ([self.delegate respondsToSelector:@selector(visitSelectedBtnClick:)])
    {
        [self.delegate visitSelectedBtnClick:btn];
    }

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
